# A plotting R script produced by the REVIGO server at http://revigo.irb.hr/ # If you found REVIGO useful in your work, please cite the following reference: # Supek F et al. "REVIGO summarizes and visualizes long lists of Gene Ontology # terms" PLoS ONE 2011. doi:10.1371/journal.pone.0021800 # -------------------------------------------------------------------------- # If you don't have the ggplot2 package installed, uncomment the following line: # install.packages ("ggplot2"); library (ggplot2); # -------------------------------------------------------------------------- # Here is your data from REVIGO. Scroll down for plot configuration options. revigo.names <- c("term_ID","description","frequency_%","plot_X","plot_Y","plot_size","log10_p_value","uniqueness","dispensability"); revigo.data <- rbind(c("GO:0006006","glucose metabolic process", 1.107, 6.462, 1.179, 5.101,-3.5560,0.629,0.000), c("GO:0006800","oxygen and reactive oxygen species metabolic process", 0.154,-3.295, 1.474, 4.210,-1.0370,0.981,0.000), c("GO:0007517","muscle organ development", 0.041,-2.370,-6.929, 3.673,-1.8845,0.888,0.000), c("GO:0015992","proton transport", 1.025,-0.634, 7.775, 5.067,-1.4103,0.908,0.000), c("GO:0060249","anatomical structure homeostasis", 0.024,-7.505,-0.448, 3.428,-1.3309,0.831,0.000), c("GO:0009820","alkaloid metabolic process", 0.004,-1.728, 2.680, 2.614,-1.1318,0.939,0.007), c("GO:0034614","cellular response to reactive oxygen species", 0.086,-3.698,-3.077, 3.992,-1.5599,0.902,0.021), c("GO:0000278","mitotic cell cycle", 0.103, 4.557,-4.793, 4.068,-1.1823,0.940,0.022), c("GO:0030029","actin filament-based process", 0.106, 0.444, 5.820, 4.084,-1.5400,0.951,0.022), c("GO:0007010","cytoskeleton organization", 0.203,-5.391, 5.388, 4.363,-2.6771,0.729,0.023), c("GO:0007017","microtubule-based process", 0.308, 0.102,-3.751, 4.546,-1.1337,0.948,0.024), c("GO:0006928","cellular component movement", 0.711, 1.790,-3.150, 4.908,-1.2289,0.946,0.026), c("GO:0006732","coenzyme metabolic process", 2.448, 2.334, 0.873, 5.445,-1.8462,0.874,0.060), c("GO:0006414","translational elongation", 0.665, 5.083, 3.527, 4.880,-3.0438,0.868,0.064), c("GO:0015980","energy derivation by oxidation of organic compounds", 4.971, 0.222, 3.218, 5.753,-1.5661,0.900,0.073), c("GO:0051186","cofactor metabolic process", 3.543, 0.290,-0.622, 5.606,-1.4957,0.914,0.077), c("GO:0006091","generation of precursor metabolites and energy", 6.142, 2.017,-5.918, 5.845,-2.7185,0.909,0.085), c("GO:0044092","negative regulation of molecular function", 0.204,-7.463,-1.965, 4.366,-1.1794,0.867,0.221), c("GO:0006090","pyruvate metabolic process", 0.041, 4.837,-0.871, 3.667,-2.4913,0.820,0.227), c("GO:0006818","hydrogen transport", 1.025,-0.417, 7.525, 5.067,-1.2269,0.949,0.299), c("GO:0009152","purine ribonucleotide biosynthetic process", 1.244, 5.692, 0.311, 5.151,-2.4832,0.601,0.314), c("GO:0006769","nicotinamide metabolic process", 0.000, 3.015, 1.335, 0.954,-1.3309,0.805,0.360), c("GO:0007264","small GTPase mediated signal transduction", 0.496,-6.356,-2.048, 4.753,-1.1356,0.805,0.384), c("GO:0006911","phagocytosis, engulfment", 0.005,-4.219, 5.999, 2.743,-1.2365,0.803,0.394), c("GO:0043242","negative regulation of protein complex disassembly", 0.014,-6.765, 2.429, 3.218,-1.9093,0.700,0.423), c("GO:0006412","translation", 4.967, 5.657, 2.329, 5.753,-1.0805,0.842,0.513), c("GO:0001763","morphogenesis of a branching structure", 0.026,-1.769,-7.051, 3.470,-1.5446,0.902,0.518), c("GO:0051094","positive regulation of developmental process", 0.070,-5.090,-4.712, 3.901,-1.2365,0.805,0.520), c("GO:0032271","regulation of protein polymerization", 0.027,-6.479, 2.829, 3.489,-1.8667,0.683,0.555), c("GO:0016052","carbohydrate catabolic process", 1.399, 3.896, 5.518, 5.203,-2.4869,0.806,0.564), c("GO:0048754","branching morphogenesis of a tube", 0.021,-1.686,-6.922, 3.372,-1.2365,0.898,0.574), c("GO:0048729","tissue morphogenesis", 0.064,-2.118,-6.947, 3.863,-1.0108,0.898,0.576), c("GO:0034654","nucleobase-containing compound biosynthetic process", 3.078, 5.259, 1.840, 5.545,-1.6010,0.752,0.593), c("GO:0010035","response to inorganic substance", 0.247,-3.678,-2.627, 4.449,-1.2175,0.940,0.597), c("GO:0043066","negative regulation of apoptotic process", 0.070,-7.848,-0.919, 3.901,-1.1179,0.791,0.607), c("GO:0016051","carbohydrate biosynthetic process", 2.083, 5.950, 2.880, 5.375,-1.2666,0.777,0.608), c("GO:0000279","M phase", 0.096, 4.558,-4.988, 4.039,-1.1443,0.940,0.631), c("GO:0030030","cell projection organization", 0.278,-5.538, 5.384, 4.500,-1.2195,0.753,0.635), c("GO:0008064","regulation of actin polymerization or depolymerization", 0.026,-6.591, 2.255, 3.464,-2.4486,0.598,0.655), c("GO:0051960","regulation of nervous system development", 0.044,-4.788,-4.992, 3.698,-1.8667,0.798,0.667), c("GO:0045454","cell redox homeostasis", 0.541,-7.302,-0.878, 4.790,-1.1179,0.773,0.684), c("GO:0030865","cortical cytoskeleton organization", 0.007,-5.227, 5.368, 2.873,-1.2405,0.739,0.691)); one.data <- data.frame(revigo.data); names(one.data) <- revigo.names; one.data <- one.data [(one.data$plot_X != "null" & one.data$plot_Y != "null"), ]; one.data$plot_X <- as.numeric( as.character(one.data$plot_X) ); one.data$plot_Y <- as.numeric( as.character(one.data$plot_Y) ); one.data$plot_size <- as.numeric( as.character(one.data$plot_size) ); one.data$log10_p_value <- as.numeric( as.character(one.data$log10_p_value) ); one.data$frequency <- as.numeric( as.character(one.data$frequency) ); one.data$uniqueness <- as.numeric( as.character(one.data$uniqueness) ); one.data$dispensability <- as.numeric( as.character(one.data$dispensability) ); #head(one.data); # -------------------------------------------------------------------------- # Names of the axes, sizes of the numbers and letters, names of the columns, # etc. can be changed below p1 <- ggplot( data = one.data ); p1 <- p1 + geom_point( aes( plot_X, plot_Y, colour = log10_p_value, size = plot_size), alpha = I(0.6) ) + scale_area(); p1 <- p1 + scale_colour_gradientn( colours = c("blue", "green", "yellow", "red"), limits = c( min(one.data$log10_p_value), 0) ); p1 <- p1 + geom_point( aes(plot_X, plot_Y, size = plot_size), shape = 21, fill = "transparent", colour = I (alpha ("black", 0.6) )) + scale_area(); p1 <- p1 + scale_size( range=c(5, 30)) + theme_bw(); # + scale_fill_gradientn(colours = heat_hcl(7), limits = c(-300, 0) ); ex <- one.data [ one.data$dispensability < 0.15, ]; p1 <- p1 + geom_text( data = ex, aes(plot_X, plot_Y, label = description), colour = I(alpha("black", 0.85)), size = 3 ); p1 <- p1 + labs (y = "semantic space x", x = "semantic space y"); p1 <- p1 + opts(legend.key = theme_blank()) ; one.x_range = max(one.data$plot_X) - min(one.data$plot_X); one.y_range = max(one.data$plot_Y) - min(one.data$plot_Y); p1 <- p1 + xlim(min(one.data$plot_X)-one.x_range/10,max(one.data$plot_X)+one.x_range/10); p1 <- p1 + ylim(min(one.data$plot_Y)-one.y_range/10,max(one.data$plot_Y)+one.y_range/10); # -------------------------------------------------------------------------- # Output the plot to screen p1; # Uncomment the line below to also save the plot to a file. # The file type depends on the extension (default=pdf). # ggsave("C:/Users/path_to_your_file/revigo-plot.pdf");